<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<style>
    .curtabtr th{height: 30px;color:#909399;}
    .curtabtr td{height: 30px}
</style>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">
        <div><?php include "../public_flow/flow_show_info.php";?></div>
        <div class="tongbox tongbox5">
            <div class="tuo"><div class="tit">项目名称</div><div class="con" id="tong_enginname"></div></div>
            <div class="tuo"><div class="tit">联营方/委托方</div><div class="con" id="tong_lian_unit"></div></div>
            <div class="tuo"><div class="tit">本次结算支付金额(元)</div><div class="con" id="tong_money"></div></div>
            <div class="tuo"><div class="tit">本次扣收合计(元)</div><div class="con" id="tong_koufee"></div></div>
            <div class="tuo"><div class="tit">结算日期</div><div class="con" id="tong_jiedt"></div></div>
        </div>
        <div class="table-box tablenes">
            <div class="title">项目信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">项目名称</td><td class="tv colorlan" id="enginid_name" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>
        <div class="table-box tablenes">
            <div class="title">项目资金信息</div>
            <table class="layui-table" lay-size="sm">
                <thead>
                <tr class="curtabtr">
                    <th colspan="3" style="text-align: center">项目收入</th>
                    <th colspan="3" style="text-align: center">项目支出</th>
                    <th rowspan="2">费用扣收(元)</th>
                    <th rowspan="2">资金余额(元)</th>
                    <th rowspan="2">待扣管理费(元)</th>
                    <th rowspan="2">待扣税费(元)</th>
                    <th rowspan="2">待扣其他费(元)</th>
                </tr>
                <tr class="curtabtr">
                    <th>工程回款金额(元)</th>
                    <th>联营方备用金(元)</th>
                    <th>收入合计(元) A</th>
                    <th>项目付款金额(元)</th>
                    <th>联营结算金额(元)</th>
                    <th>支出合计(元) B</th>
                </tr>
                </thead>
                <tbody class="short_table_tbody" style="min-height: unset!important;">
                <tr class="curtabtr">
                    <td id="shougonghuifee"></td>
                    <td id="shoulianbeifee"></td>
                    <td id="lianyingshoufee"></td>
                    <td id="zhixiangfee"></td>
                    <td id="zhilianjiefee"></td>
                    <td id="lianyingzhifee"></td>
                    <td id="kou_allfee"></td>
                    <td id="balancefee2"></td>
                    <td id="dai_guanfee"></td>
                    <td id="dai_shuifee"></td>
                    <td id="daikouqidaifee"></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="table-box tablenes">
            <div class="title">资金核算</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">项目资金余额(元)</td><td class="tv" id="balancefee"></td><td class="tt">本次结算是否扣收</td><td class="tv" id="iskou"></td></tr>
                <tr class="iskoushi layui-hide"><td class="tt">本次扣收合计(元)</td><td class="tv" id="koufee"></td><td class="tt">其中管理费扣收(元)</td><td class="tv" id="kouguanfee"></td></tr>
                <tr class="iskoushi layui-hide"><td class="tt">其中税费扣收(元)</td><td class="tv" id="koushuifee"></td><td class="tt">其中其他费扣收(元)</td><td class="tv" id="kouqifee"></td></tr>
                <tr><td class="tt">本次结算净额(元)</td><td class="tv" id="jingfee"></td><td class="tt">结算日期</td><td class="tv" id="jiedt"></td></tr>
                <tr><td class="tt">本次结算后管理费待扣(元)</td><td class="tv" id="daiguanfee"></td><td class="tt">本次结算后税费待扣(元)</td><td class="tv" id="daishuifee"></td></tr>
                <tr><td class="tt">本次结算后其他费待扣(元)</td><td class="tv" id="daiqifee" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">结算支付信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">结算单号</td><td class="tv" id="number"></td><td class="tt">款项类型</td><td class="tv" id="feilei_name"></td></tr>
                <tr><td class="tt">费用项</td><td class="tv" id="feitype_name"></td><td class="tt">款项摘要</td><td class="tv" id="zhai"></td></tr>
                <tr><td class="tt">本次结算支付金额(元)</td><td class="tv" id="money" colspan="3"></td></tr>
                <tr><td class="tt">支付方式</td><td class="tv" id="incdaotype_name"></td><td class="tt">收款方</td><td class="tv" id="duier"></td></tr>
                <tr><td class="tt">账户账号</td><td class="tv" id="banknum"></td><td class="tt">开户行</td><td class="tv" id="bankname"></td></tr>
                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>


        <div class="table-box tablenes">
            <div class="title">支付信息(出纳)</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">支付状态</td><td class="tv" id="paystate_name"></td><td class="tt">最近支付日期</td><td class="tv" id="paylastdt"></td></tr>
                <tr><td class="tt">已支付金额(元)</td><td class="tv" id="payfee"></td><td class="tt">未支付金额(元)</td><td class="tv" id="paynofee"></td></tr>
                </tbody>
            </table>
        </div>
        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>

        <div class="table-box tablenes iskoushi layui-hide">
            <script type="text/html" id="toolbarDemo_kou">扣收明细</script>
            <div class="tableShow">
                <table id="datalist_kou" lay-filter="datalist_kou"></table>
            </div>
        </div>

        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>

    <?php include 'showrrboxtext.php'?>
    <div><?php include '../public/shrrbox.php'?></div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_zhi_lianjie_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                var engininfo = res.data.engininfo;
                $("#flowdingname").text(data.zhai);

                if(engininfo){
                    $("#tong_enginname").text(engininfo.name);
                    $("#tong_lian_unit").text(engininfo.lian_unit);
                }
                $("#tong_money").text(parseFormatNum(data.money));
                $("#tong_koufee").text(parseFormatNum(data.koufee));
                $("#tong_jiedt").text(data.jiedt);


                set_right_relainfo(engininfo);









                var kuaninfo = res.data.kuaninfo;
                if(kuaninfo){
                    $("#paystate_name").text(kuaninfo.paystate_name);
                    $("#paylastdt").text(kuaninfo.paylastdt);
                    $("#payfee").text(parseFormatNum(kuaninfo.payfee)).addClass('colorlan').click(function () {
                        openNavPage('查看交易明细信息','account_list/index.php?kuanid='+kuaninfo.id);
                    });
                    $("#paynofee").text(parseFormatNum(kuaninfo.paynofee));
                }



                if(engininfo){
                    $("#enginid_name").text(engininfo.name).click(function () {
                        openPage('../engin/show.php?id='+engininfo.id);
                    });
                    $("#shougonghuifee").text(parseFormatNum(engininfo.shougonghuifee));
                    $("#shoulianbeifee").text(parseFormatNum(engininfo.shoulianbeifee));
                    $("#lianyingshoufee").text(parseFormatNum(engininfo.lianyingshoufee));
                    $("#zhixiangfee").text(parseFormatNum(engininfo.zhixiangfee));
                    $("#zhilianjiefee").text(parseFormatNum(engininfo.zhilianjiefee));
                    $("#lianyingzhifee").text(parseFormatNum(engininfo.lianyingzhifee));
                    $("#kou_allfee").text(parseFormatNum(engininfo.kou_allfee));
                    $("#balancefee2").text(parseFormatNum(engininfo.balancefee));
                    $("#dai_guanfee").text(parseFormatNum(engininfo.dai_guanfee));
                    $("#dai_shuifee").text(parseFormatNum(engininfo.dai_shuifee));
                    $("#daikouqidaifee").text(parseFormatNum(engininfo.daikouqidaifee));
                }


                $("#balancefee").text(parseFormatNum(data.balancefee));
                $("#iskou").text(data.iskou);
                $("#koufee").text(parseFormatNum(data.koufee));
                $("#kouguanfee").text(parseFormatNum(data.kouguanfee));
                $("#koushuifee").text(parseFormatNum(data.koushuifee));
                $("#kouqifee").text(parseFormatNum(data.kouqifee));
                $("#jingfee").text(parseFormatNum(data.jingfee));
                $("#jiedt").text(data.jiedt);
                $("#daiguanfee").text(parseFormatNum(data.daiguanfee));
                $("#daishuifee").text(parseFormatNum(data.daishuifee));
                $("#daiqifee").text(parseFormatNum(data.daiqifee));

                $("#number").text(data.number);
                $("#feilei_name").text(data.feilei_name);
                $("#feitype_name").text(data.feitype_name);
                $("#zhai").text(data.zhai);
                $("#money").text(showChineseNumber(data.money));
                $("#incdaotype_name").text(data.incdaotype_name);
                $("#duier").text(data.duier);
                $("#banknum").text(data.banknum);
                $("#bankname").text(data.bankname);
                $("#explain").text(data.explain);



                if(data.iskou == '是') {
                    $(".iskoushi").removeClass('layui-hide');

                    var koutableList = table.render({
                        elem: "#datalist_kou",data:res.data.kou, toolbar: '#toolbarDemo_kou', page: false
                        ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                        ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                        ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                        , cols: [[
                            {type:'numbers',title:'序号',fixed:'left'}
                            ,{field: 'lai', title: '来源'}
                            ,{field: 'feitype_name', title: '费用项'}
                            ,{field: 'money', title: '扣收金额(元)',align:'right',templet: function(d){return parseFormatNum(d.money);}}
                            ,{field: 'explain', title: '款项说明'}
                        ]]
                        , done: function (res) {
                            soulTable.render(this);
                        }
                    });
                }


                public_flow_show_display(res.data.billinfo);
                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('zhi_lianjie', param_id);
    });



</script>
</body>
</html>




